﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Slja.BLL;
using Slja.Model;
using System.Text;

namespace FrameWork.web.Web.UC
{
    public partial class DescInfo : System.Web.UI.UserControl
    {
        string _DescHtml=null;
        DescrType _DescriptionType = DescrType.None;
        string _ObjKey=null;
        /// <summary>
        /// 控件的描述类型
        /// </summary>
        public DescrType DescriptionType
        {
            set {_DescriptionType = value;}
            get{return _DescriptionType;}
        }
        /// <summary>
        /// 描述对象的主键ID
        /// </summary>
        public string ObjKey
        {
            get{return _ObjKey;}
            set {_ObjKey = value;}
        }
        protected string DescHtml
        {
            get { return _DescHtml; }
        } 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //联系人提示信息
                if (_DescriptionType == DescrType.LinkMan && _ObjKey !=null)
                {
                    LinkManBLL bll = new LinkManBLL();
                    int lnkID ;
                    if (int.TryParse(_ObjKey, out lnkID) && lnkID>0)
                    {
                        LinkManModel mdl = bll.GetModel(lnkID);
                        ltrOutputDescrInfo.Text = DescriptioBLL.Output_LinkMan(mdl);
                    }
                    
                }
            }
        }
      
    }
}